# Contributor: Guy Godfroy <guy.godfroy@gugod.fr>
# Maintainer: Guy Godfroy <guy.godfroy@gugod.fr>
pkgname=py3status
pkgver=3.60
pkgrel=0
pkgdesc="Extensible i3status wrapper written in python"
url="https://ultrabug.github.io/py3status/"
arch="noarch"
license="BSD-3-Clause"
depends="py3-setuptools"
makedepends="
	py3-gpep517
	py3-installer
	py3-wheel
	py3-hatchling
	"
checkdepends="py3-pytest"
subpackages="$pkgname-doc $pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/ultrabug/py3status/archive/refs/tags/$pkgver.tar.gz"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl

	install -Dm644 docs/*.md README.md CHANGELOG \
		-t "$pkgdir"/usr/share/doc/$pkgname/
	install -Dm644 docs/dev-guide/* \
		-t "$pkgdir"/usr/share/doc/$pkgname/dev-guide/
	install -Dm644 docs/user-guide/* \
		-t "$pkgdir"/usr/share/doc/$pkgname/user-guide/
	install -Dm644 LICENSE \
		-t "$pkgdir"/usr/share/licenses/$pkgname/
}

sha512sums="
124a83fa1fca28ae046ee1b0c4c51beb1a0c21596dd55f95f87ad0ef1dca329fd1aa0fe64258c322d387a168cc7b33568d2c53be66981b77b7f5a88aaa8c95ab  py3status-3.60.tar.gz
"
